﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class PopWin_personaldatails : System.Web.UI.Page
{
    PM.Model.Sys_Account teacher = null;
    PM.PMSys.account account = new PM.PMSys.account();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["id"] != null)
        {
            teacher = new PM.Model.Sys_Account();
            teacher = account.GetModel(Request.QueryString["id"].ToString());
            if (teacher != null)
                setModel(teacher);
            else
                PM.Code.Web.alertmessage.ShowMsg("抱歉，获取信息失败！数据库中无此人！");
        }
        else
            Response.Redirect("../Error/Error.htm");
    }
    //添加数据
    public void setModel(PM.Model.Sys_Account myself)
    {
        this.labID.Text = myself.tid;
        this.labName.Text = myself.name;
        this.labSex.Text = myself.sex;
        this.labDepart.Text = myself.depart;
        this.labField.Text = myself.field;
        this.labBg.Text = myself.bg.Trim();
        this.labTitle.Text = myself.title;
        this.labPhone.Text = myself.telephone;
        this.labCell.Text = myself.cellphone;
        this.labMail.Text = myself.email;
        this.labRemark.Text = myself.intro;
        if (myself.usertype == 1)
            this.labUserType.Text = "普通用户";
        else if (myself.usertype == 2)
            this.labUserType.Text = "学院管理员";
        else if (myself.usertype == 3)
            this.labUserType.Text = "项目管理员";
        else if (myself.usertype == 4)
            this.labUserType.Text = "学院管理员";
        else
            this.labUserType.Text = "其他";
    }
}
